public class test1 {
    private static int n = 100000;
    public static void main(String[] args) {
        int [] a = new int[n];
        for(int i = 0; i < n; i++)
            a[i] = (int) (Math.random()*10000);
        Stopwatch watch = new Stopwatch();
        watch.start();
        sellectSort(a);
        watch.end();
        watch.getElapsedTime();
    }

    private static void sellectSort(int[] a)
    {

        for(int i = 0; i < n - 1; i++)
        {
            int min = i;
            for(int j = i + 1; j < n; j++)
            {
                if(a[j] < a[min])
                    min = j;
            }
            int tmp = a[i];
            a[i] = a[min];
            a[min] = tmp;
        }
    }
}
